package util ;

/**
 * an object (user, forum etc..) was being added to the system, while already
 * existing in it.
 * 
 * @author idan
 */
public class DuplicationException extends Exception
{
	/***/
	private static final long serialVersionUID = -992439771582451430L ;

	private final Object duplicate ;

	/**
	 * @param duplicate the redundant object.
	 */
	public DuplicationException(final Object duplicate)
	{
		super() ;
		this.duplicate = duplicate ;
	}

	/**
	 * @param message what was the error?
	 * @param duplicate the redundant object.
	 */
	public DuplicationException(final String message, final Object duplicate)
	{
		super(message) ;
		this.duplicate = duplicate ;
	}

	/**
	 * @return the redundant object.
	 */
	public Object getDuplicate()
	{
		return this.duplicate ;
	}

}
